package com.example.automanagement.mapper;

import com.example.automanagement.entity.AutoArchives;
import lombok.Data;
import org.apache.ibatis.annotations.*;

import java.util.*;

@Mapper
public interface ArchiveMapper {
    //@Select("select * from auto_archives")
    List<AutoArchives> list();

    void add(AutoArchives archives) ;

    @Delete("delete from auto_archives where auto_id = #{autoId}")
    void delete(AutoArchives archives);

    void update(AutoArchives archives);

    @Select("select auto_plate_num from auto_archives")
    List<AutoArchives> fetchPlates();

    @Select("select * from auto_archives where auto_id = #{autoId}")
    AutoArchives getArchiveById(String autoId);

    @Select("select * from auto_archives where auto_plate_num = #{autoPlate}")
    AutoArchives getAutoIdByPlate(String autoPlate);
}
